sudo -u postgres psql
postgres=# create database mydb;
postgres=# create user myuser with encrypted password 'mypass';
postgres=# grant all privileges on database mydb to myuser;
$ docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres
docker run --name postgres-db -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
$ docker exec -it my_postgres psql -U postgres -c "create database my_database"
createdb -h localhost -p 5432 -U postgres testdb
password ******